<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<script>
  const p = new Promise((resolve, reject) => {
    let num = 1;
    setTimeout(() => {
      ++num
      console.log(num)
    }, 5000)
    console.log(num)
    num++
    console.log(num)
    let a = num
    let b = 10
    resolve(a)
    reject(b)

  })
    .then(value => {
        return new Promise((resolve, reject) => {
          setTimeout(() => {
            let c = value
            c++
            console.log(value)
            console.log(c)
          }, 1000)
        })
      },
      reason => {
        let d = reason
        d++
        console.log(d)
        console.log(reason)
      })
</script>

</body>
</html>